import 'package:get/get.dart';
import 'package:new_yuqib_app/yqbConfig/yqb_base.dart';
import 'package:new_yuqib_app/yqbModel/video_data_model.dart';
import 'package:new_yuqib_app/yqbNetwork/api_metholds.dart';
import 'package:video_player/video_player.dart';

class HomeViewController extends GetxController {

  var  videoPlayerController = VideoPlayerController.networkUrl(Uri.parse("uri")).obs;

  var videoData = <VideoDataModel>[].obs;

  @override
  void onInit() {
    super.onInit();
    videoList();
    caseExample();
  }

 @override
  void onReady() {
    super.onReady();
    videoPlayerController.value = VideoPlayerController.networkUrl(Uri.parse(testVideoUrl))..initialize().then((value){
      videoPlayerController.value.play();
    });
  }

  //案例列表
  caseExample(){
    ApiMethods.caseExample().then((value){});
  }

  //視頻列表
  videoList(){
    ApiMethods.videoList().then((value){
      videoData.clear();
      videoData.addAll(value);
    });
  }

}